﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Configuration;

namespace Kokomo.Environment.Services
{
	/// <summary>
	/// Provides functionality for loading and saving settings.
	/// </summary>
	/// <remarks>
	/// The environment provides an implementation of this interface,
	/// and can be retrieved via <see cref="EnvironmentServices"/>.
	/// </remarks>
	public interface ISettingsManager
	{
		/// <summary>
		/// Gets an instance of a settings object.
		/// </summary>
		/// <typeparam name="TSettings">The type of the settings object.</typeparam>
		/// <returns>The loaded instance of <typeparamref name="TSettings"/></returns>
		/// <remarks>
		/// The default implementation loads only one instance of each type of settings object,
		/// then retains it in memory until the application exits.
		/// </remarks>
		TSettings GetSettings<TSettings>()
			where TSettings : SettingsBase, new();
		/// <summary>
		/// Saves all settings to persistent storage.
		/// </summary>
		void SaveAllSettings();
	}
}
